package com.meilishuo.message.util.respon;

import com.alibaba.fastjson.JSON;
import com.alibaba.fastjson.JSONObject;
import com.google.gson.JsonObject;
import com.meilishuo.message.util.MisCleint;
import com.meilishuo.message.util.request.OrderDetailRequest;

import java.util.TreeMap;

/**
 * 获得订单详情
 * session 用户的授权码
 * order_id 订单编号
 * responResult 返回json格式
 */
public class OrderDetailResponse {
    public String getOrderByOne(OrderDetailRequest request,String session){
        TreeMap<String,String> appParams=new TreeMap<String, String>();
        appParams.put("method","meilishuo.order.detail.get");
        appParams.put("session",session);
        appParams.put("order_id",request.getOrder_id());
//        JSONObject json = JSON.parseObject(text)  
        String result= MisCleint.excuteApi(appParams);
        JSONObject orderDetailJson=JSON.parseObject(result);
        System.out.println(orderDetailJson.get("error_response"));
        return result;
    }
}
